/**
 * 
 */
package com.lijin.workshop.entity;

import java.util.Collections;
import java.util.List;

/**
 * @author jin
 *
 */
public class Pager<T> {

	private int pageNum = 1; // 默认从第一页开始查询
	private int pageSize = 10; // 分页条数默认为10
	private int total = 0;
	
	private List<T> resultList;
	
	public int getPageNum() {
		return pageNum;
	}
	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public List<T> getResultList() {
		if (resultList == null) {
			resultList = Collections.emptyList();
		}
		return resultList;
	}
	public void setResultList(List<T> resultList) {
		this.resultList = resultList;
	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	public int getStartNum() {
		return (pageNum - 1) * pageSize;
	}
}
